﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Composite.Regions;
using MP3Ganizer.Common.Interfaces.MassEditor;
using MP3Ganizer.Modules.MassEditor.Views;
using MP3Ganizer.Modules.MassEditor.ViewModels;
using MP3Ganizer.Modules.MassEditor.Controllers;
using Microsoft.Practices.Composite.Modularity;
using MP3Ganizer.Common.BaseObject;

namespace MP3Ganizer.Modules.MassEditor
{
    [Module(ModuleName = "MassEditorModule"), ModuleDependency("InfrastructuresModule")] 
    public class MassEditorModule : BaseModule<IMassEditorController>
  { 
   
    /// <summary>
    /// Constructeur. Avec passage du UnityContainer.
    /// </summary>
    /// <param name="unityContainer"></param>
    public MassEditorModule(IUnityContainer unityContainer, IRegionManager regionManager):base(unityContainer, regionManager)
    {
    }

    /// <summary>
    /// Fonction regroupant les enregistrements dans le container.
    /// </summary>
    protected override void RegisterViewsAndServices()
    {
      // Exemple de register en singleton :
        Container.RegisterType<IMassEditorView, MassEditorView>();
        Container.RegisterType<IMassEditorViewModel, MassEditorViewModel>(new ContainerControlledLifetimeManager());
        Container.RegisterType<IArtistsEditorViewModel, ArtistsEditorViewModel>(new ContainerControlledLifetimeManager());
        Container.RegisterType<IAlbumsEditorViewModel, AlbumsEditorViewModel>(new ContainerControlledLifetimeManager());
        Container.RegisterType<IMassEditorController, MassEditorController>();
    }
  }
}
